package com.ygq.controller;

import com.ygq.pojo.Persons;
import com.ygq.service.PersonsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class PersonsController {
    @Autowired
    private PersonsService personsService;

    @RequestMapping("/index")
    public String index(Model model,String name ,String sex){
        model.addAttribute("list",personsService.findPersons());
        return "index";
    }
}
